home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / Inspectors / InspectMe / ColorInspector.h < prev    next >
Text File  |  1995-06-12  |  2KB  |  60 lines

  1. // ColorInspector.h
  2. // By Kevin Brain (ksbrain@zeus.UWaterloo.ca)
  3.  
  4. // ColorInspector is responsible for the 'color' inspector view. 
  5.  
  6. // This class is an example of a class that is responsible for
  7. // a set of inspector views in an application.  Such classes 
  8. // act as intermediaries between the controls of inspector
  9. // views and the currently selected object.  These classes
  10. // have outlets to each control in the inspector views it is 
  11. // responsible for, and methods that act as the targets for 
  12. // each of these controls.  This intermediary class is
  13. // necessary because the application can have more than one 
  14. // "inspectable views", each which may be "inspected" on a 
  15. // particular "inspector view", so we don't directly connect
  16. // the inspector controls to the actual object that the control
  17. // is currently affecting.  Instead, the controls are connected
  18. // to the inspSet{*} methods of this class, and these methods
  19. // send a corresponding message to the object itself.  They do
  20. // this by sending the message to the 'currentParameterReceiver'.
  21. // This means that a setCurrentParameterReceiver: message must 
  22. // be sent to this class when a new object is selected to set 
  23. // the object as the currentParameterReceiver.  (Another option 
  24. // is to have the inspSet{*} methods find out the currently 
  25. // selected object (somehow) at the time it is invoked.)
  26. // The reflect{*}Attributes: methods reflect the attributes of an
  27. // object on the controls of a particular inspector view.
  28. // The {*}InspectorNum methods return the inspector number 
  29. // assigned to the inspector when it was given to InspectorManager
  30. // in the setupInspectors: method.
  31. // Notice how this class is set up to have only one instance in 
  32. // an application.  After the first instance of the class is 
  33. // created using the 'class method 'new', subsequent calls to
  34. // new return a pointer to this single instance.
  35.  
  36. #import <objc/Object.h>
  37.  
  38. @interface ColorInspector:Object
  39. {
  40.     id    colorBox;
  41.     id    currentParameterReceiver;
  42.     id    inspectorManager;
  43.     
  44.     int    bkgndColorInspectorNum;
  45.     
  46.     id    colorWellOut;
  47.     id    graySliderOut;
  48. }
  49.  
  50. - setupInspectors:(id)mainInspector;
  51. - setCurrentParameterReceiver:(id)newCurrent;
  52. - (unsigned int)bkgndColorInspectorNum;
  53.  
  54. - reflectbkgndColorAttributes:(id)theObject;
  55.  
  56. - inspSetGray:sender;
  57. - inspSetColor:sender;
  58.  
  59. @end
  60.